How to get the target object during link create trigger

Hello together,

I've noticed that since 9.6.1.7 the triggers have been enhanced and now also the link creation (and deletion) can be connected to a pre-/post trigger.

I've now added this trigger to my "test" DXL code (which just print all available trigger information) but was not able to get the "target" object when connection this to a "Pre link creation" trigger.

Is it (now?) possible to decide if a link can be created or not, depending of some information stored in the target object?

 

For example: The target object has an attribute like "Traceable" and links to this object shall only be possible if this attribute is - for example - "True".... Can I get information of the target object?

Getting the "source" object is very easy with:

Object oObject = object (current Trigger)

but how do I get the target object? I tried with "target(current Trigger)" and LinkRef-variants and hoped for some undocumented functions, but all ended in DXL script errors.

The link creation itself I can allow or deny by setting the TriggerStatus (trigPreConPass/trigPreConFail), but I've not figured out how to decide which I've to set, because the result depends of the target and this I'm not able to figure out. Does anybody knows the solution?

 

Best regards,

Michael


MichaelBrockhaus - Thu Feb 28 03:57:01 EST 2019

Re: How to get the target object during link create trigger
O.Wilkop - Thu Feb 28 07:02:21 EST 2019

Have you tried

 

Object objTarget = linkTarget(current Trigger);

?

Re: How to get the target object during link create trigger
MichaelBrockhaus - Fri Mar 01 03:19:11 EST 2019

O.Wilkop - Thu Feb 28 07:02:21 EST 2019

Have you tried

 

Object objTarget = linkTarget(current Trigger);

?

Yeah; you're my hero :-) It works! Thank you very much!!

I love these "undocumented" features... Okay, this function is part of the DXL Reference Manual 9.6.1, but only as exactly one word in the "Module menus -> Standard items" chapter... That this is a function,...

Once again: Thanks a lot!